// 引入组件
import AddressIndex from '@/components/address/index.vue'
import AddressAdd from '@/components/address/add.vue'
import AddressEdit from '@/components/address/edit.vue'

// 定义一个路由列表(子路由)
const list = [
    {
        // 收货地址列表
        path: 'index',
        name: 'AddressIndex',
        component: AddressIndex,
        meta: { IsLogin: true }
    },
    {
        // 收货地址添加
        path: 'add',
        name: 'AddressAdd',
        component: AddressAdd,
        meta: { IsLogin: true }
    }, {
        // 收货地址编辑
        path: 'edit',
        name: 'AddressEdit',
        component: AddressEdit,
        meta: { IsLogin: true }
    },
]

// 父级的组件模板
const layout = {
    template: `<router-view />`
}

export default [
    {
        path: '/address',
        name: 'address',
        component: layout,
        children: list
    }
]
